home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / CLPARM.HPP < prev    next >
C/C++ Source or Header  |  1993-08-24  |  4KB  |  125 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    clparm.hpp
  5. //   Title:    C++ Class Libraries
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //    This module contains code for the class CL_PARM.
  24. //
  25. //    The code in this module may be written in C++ or C.
  26. //
  27. //    This module is portable to:
  28. //        DOS 3.X+
  29. //        MS Windows 3.X+
  30. //        OS/2 2.X+
  31. //        OS/2 2.0 PM
  32. //
  33. //    The following compilers are supported:
  34. //        MSC 6.0A
  35. //        MSC/C++ 7.0
  36. //        Borland C++ 3.1 for DOS
  37. //        Borland C++ 1.0 for OS/2 2.X
  38. //
  39. //----------------------------------------------------------------------------
  40.  
  41.  
  42. //----------------------------------------------------------------------------
  43. //    Class CL_PARM
  44. //----------------------------------------------------------------------------
  45. #define CL_PARM_PARENT CL_OBJECT
  46. class CLASSTYPE CL_PARM : public CL_PARM_PARENT
  47. {
  48.     BOOL fValid;                                // Parm is valid
  49.     BOOL fText;                                    // Parm is text
  50.     BOOL fNumeric;                                // Parm is numeric
  51.     LONG lVal;                                    //    Numeric value
  52.     LONG lMin, lMax;                            //    Min/max value of numeric
  53.     CL_STRING strVal;                            // Text value
  54.     CL_STRING strName;                        // Name of parameter
  55.  
  56. public:
  57.     static PCSZ pcszParmName;
  58.     static PCSZ pcszGarbleName;
  59.  
  60.     FN_M CL_PARM();
  61.     FN_M CL_PARM(RCCL_PARM);
  62.     virtual FN_M ~CL_PARM();
  63.  
  64.     virtual BOOL FN_M Destroy(BOOL = TRUE);
  65.     BOOL FN_M Get(PCSZ = NULL, PCSZ = NULL);
  66.     BOOL FN_M Get(LONG, PCSZ = NULL);
  67.     static BOOL FN_M GetCfg(PBS_CFG);
  68.     virtual BOOL FN_M Initialize(SHORT = CL_INIT_ALL);
  69.     virtual BOOL FN_M IsError() const;
  70.     virtual BOOL FN_M IsNumeric() const
  71.         {
  72.         return fNumeric;
  73.         }
  74.     virtual BOOL FN_M IsValid() const;
  75.     BOOL FN_M MinMax(LONG = MIN_LONG, LONG = MAX_LONG);
  76.     PCSZ FN_M Name() const
  77.         {
  78.         return (PCSZ)strName;
  79.         }
  80.     RCCL_PARM FN_M operator=(RCCL_PARM);
  81.     RCCL_PARM FN_M operator=(BYTE);
  82.     RCCL_PARM FN_M operator=(CHAR);
  83.     RCCL_PARM FN_M operator=(LONG);
  84.     RCCL_PARM FN_M operator=(PCSZ);
  85.     RCCL_PARM FN_M operator=(PSZ);
  86.     RCCL_PARM FN_M operator=(SHORT);
  87.     RCCL_PARM FN_M operator=(ULONG);
  88.     RCCL_PARM FN_M operator=(USHORT);
  89.     FN_M operator BYTE() const;
  90.     FN_M operator CHAR() const;
  91.     FN_M operator LONG() const;
  92.     FN_M operator PCSZ() const;
  93.     FN_M operator PSZ() const;
  94.     FN_M operator SHORT() const;
  95.     FN_M operator ULONG() const;
  96.     FN_M operator USHORT() const;
  97.     FN_M operator RCL_STRING() const;
  98.     virtual BOOL FN_M Retrieve(PCSZ, PCSZ = NULL);
  99.     BOOL FN_M Set(PCSZ = NULL);
  100.     static BOOL FN_M SetCfg(PBS_CFG);
  101.     BOOL FN_MV SetName(PCSZ...);
  102.     virtual BOOL FN_M Store(PCSZ, PCSZ = NULL);
  103.  
  104. #if COMPILE_DEBUG
  105.     static VOID FN_M Print(PCCL_PARM = NULL, PCSZ = NULL, SIZET = 0);
  106.     static BOOL FN_M Test(SHORT = 0);
  107. #endif
  108.  
  109. protected:
  110.     BOOL FN_M SetValue(LONG);
  111.     BOOL FN_M SetValue(PCSZ);
  112.  
  113. private:
  114.     static PCSZ pcszVersion;
  115.     static PCSZ pcszAccess;
  116.     static PCSZ pcszSerial;
  117.     static PCSZ pcszCopyright;
  118.     static PCSZ pcszId;
  119.     static PCSZ pcszName;
  120.     static PCSZ pcszRegister;
  121. };
  122. //----------------------------------------------------------------------------
  123. //------------------------------- End of File --------------------------------
  124. //----------------------------------------------------------------------------
  125.